/*
* @Author: Administrator
* @Date:   2017-08-15 11:10:14
* @Last Modified by:   Administrator
* @Last Modified time: 2017-08-15 13:10:13
*/
'use strict';
require('./index.css');
require('util/swiper/index.js');

var _common = require('util/common.js');
var _setting = require('service/setting-service.js');
/*var templateIndex = require('./index.string');*/
var templateBanner = require('./banner.string');

var page = {
    init: function(){
        this.onLoad();
    },
    onLoad : function(){
        // 加载首页banner图
        this.loadBannerImage();
    },
    // 加载首页banner图
    loadBannerImage :function(){
        var mySwiper = new Swiper ('.swiper-container', {
                    autoplay: 5000,//可选选项，自动滑动
                    loop: true,
                    paginationClickable :true,
                    // 如果需要分页器
                    pagination: '.swiper-pagination'
                  })
       /* _setting.bannerImage(function(res){
                console.log(res);
                var bannerHtml = _mm.renderHtml(templateBanner, {bannerList : res.links});
                $('.banner-con').html(bannerHtml);
                var mySwiper = new Swiper ('.swiper-container', {
                    autoplay: 5000,//可选选项，自动滑动
                    loop: true,
                    paginationClickable :true,
                    // 如果需要分页器
                    pagination: '.swiper-pagination',
                    // 如果需要前进后退按钮
                    nextButton: '.swiper-button-next',
                    prevButton: '.swiper-button-prev'
                  })        
            }, function(errMsg){
                _common.errorTipes(errMsg);
            }
        )*/
    }
};

$(function(){
    page.init();
});